

<?php

$attributes = array('id' => 'login_form');
?>

<div class="modal <?php echo  flash_message() == "" ? "fade":"" ?> hide" id="myModal">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal">
			×
		</button>
		<h3>Admin Login</h3>
	</div>
	<div class="modal-body">
		<?php echo form_open('login/validate_credentials', $attributes); ?>
		<fieldset>
			<div class="clearfix">
				<label for="username">Username</label>
				<input type="text" id="username" name="username">
			</div>
			<div class="clearfix">
				<label for="password">Password</label>
				<input type="password" id="password" name="password" >
			</div>
		</fieldset>
		<?php if (flash_message()!="") { ?>
		<p>
		
		<?php echo flash_message(); ?>	
			
		</p>

		<?php }	?>

	</div>
	<div class="modal-footer">
		<input type="reset" class="btn" data-dismiss="modal" value="Cancel" />

		<?php

		$data = array('name' => 'button', 'id' => 'button', 'value' => 'Login', 'type' => 'submit', 'class' => 'btn btn-primary');

		echo form_submit($data);
		?>
	</div>

	<?php echo form_close(); ?>

</div>

<!-- Le javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="<?php echo base_url(); ?>/js/jquery-1.7.2.min.js"></script>
<script src="<?php echo base_url(); ?>/js/bootstrap.min.js"></script>
<script src="<?php echo base_url(); ?>/js/bootstrap-modal.js"></script>
<script src="<?php echo base_url(); ?>/js/respond.min.js"></script>

<script>
	$(document).ready(function() {

		$("#myModal").modal({

			backdrop : true,
			keyboard : false,
			show : true

		});

		$('#myModal').on('hide', function() {
			return false;
		});

	});

</script>

